import { defineUserConfig } from "vuepress";
import recoTheme from "vuepress-theme-reco";
import { viteBundler } from "@vuepress/bundler-vite";
import { getFilesInDirectory } from "./utils/getFiles";

type BASEPATH = "/" | "/hl-blog/";
const base = process.env.BASEPATH as BASEPATH;

// 获取查漏补缺文件
const files = getFilesInDirectory(`./docs/interview-questions`);

export default defineUserConfig({
	title: "一枚程序猿",
	description: "Just playing around",
	bundler: viteBundler(),
	base,
	open: true,
	head: [
		["link", { rel: "icon", href: "/logo.svg" }], // 添加网站图标
	],
	theme: recoTheme({
		locales: {},
		logo: "/logo.svg",
		// author: "turn_back_future",
		// authorAvatar: "/head.png",
		docsRepo: "https://gitee.com/turn_back_future/personal-blog-website",
		docsBranch: "main",
		lastUpdatedText: "上次更新",
		catalogTitle: "目录",
		series: {
			"/docs/interview-questions/": files,
		},
		navbar: [
			{ text: "首页", link: "/" },
			{ text: "博客", link: "/categories/qianduankuangjia/1" },
			{ text: "时间线", link: "/timeline.html" },
			{
				text: "文档",
				children: [
					{ text: "面试题解", link: "/docs/interview-questions/home" },
					{ text: "关于作者", link: "/blogs/other/about.html" },
				],
			},
		],
		pages: [],
	}),
});
